<template>
  <!-- 设计师 -->
  <div>
    <div class="long-advert" v-if="wideGoods.length">
      <div class="long-box">
        <img v-lazy="wideGoods[0].img" alt="" v-if="wideGoods[0].img">
        <button @click="editItem(0)">编辑</button>
      </div>
      <div class="long-box">
        <img v-lazy="wideGoods[1].img" alt="" v-if="wideGoods[1].img">
        <button @click="editItem(1)">编辑</button>
      </div>
      <div class="long-box">
        <img v-lazy="wideGoods[2].img" alt="" v-if="wideGoods[2].img">
        <button @click="editItem(2)">编辑</button>
      </div>
    </div>

    <div class="long-advert" v-else>
      <div class="long-box">
        <button @click="editItem(0)">编辑</button>
      </div>
      <div class="long-box">
        <button @click="editItem(1)">编辑</button>
      </div>
      <div class="long-box">
        <button @click="editItem(2)">编辑</button>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  props: {
    floorId: String,
    wideGoods: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  methods: {
    editItem(pos) {
      this.$emit('on-edit', this.floorId, 'designer', pos)
    }
  }
}
</script>

<style lang='scss' scoped>
@import '../../../scss/_var.scss';
.long-advert {
  width: 100%;
  .long-box {
    width: 100%;
    height: 46px;
    margin-top: 10px;
    background: $bg-gray;
    position: relative;
    button {
      width: 40px;
      height: 20px;
      border-radius: 10px;
      background: $color-main;
      position: absolute;
      top: 10px;
      right: 10px;
      color: #fff;
      font-size: 12px;
    }
  }
}

</style>
